﻿using Assistant;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YoucaiReader.Entities;

/**
 * 创建时间：2014/9/20 12:38:01
 * 作者：yong.blackcore
 * Email：itblackhole@outlook.com
 * QQ：50404503
 */
namespace YoucaiReader.Helper
{
    /// <summary>
    /// App自带书籍
    /// </summary>
    public class InternalDefaultBook
    {
        public static void AddInternalBook()
        {
            BookListModel t_m = new BookListModel(), t_m2 = new BookListModel(), t_m3 = new BookListModel(), t_m4 = new BookListModel();
            t_m.int_IsDownload_M = 2;
            t_m.int_ProgressValue_M = 0xbb;
            t_m.str_Author_M = "作者：《腾讯十年》创作组";
            t_m.str_Cover_M = "/Images/InternalDefaultBook/txsn10001.jpg";
            t_m.str_Id_M = "txsn10001";
            t_m.str_Title_M = "腾讯十年";
            t_m2.int_IsDownload_M = 2;
            t_m2.int_ProgressValue_M = 0xbb;
            t_m2.str_Author_M = "作者：张景想";
            t_m2.str_Cover_M = "/Images/InternalDefaultBook/smzhx10002.jpg";
            t_m2.str_Id_M = "smzhx10002";
            t_m2.str_Title_M = "神秘的自画像";
            t_m3.int_IsDownload_M = 2;
            t_m3.int_ProgressValue_M = 0xbb;
            t_m3.str_Author_M = "作者：尚莞";
            t_m3.str_Cover_M = "/Images/InternalDefaultBook/xchya10003.jpg";
            t_m3.str_Id_M = "xchya10003";
            t_m3.str_Title_M = "恋上你的好：校草很有爱";
            t_m4.int_IsDownload_M = 2;
            t_m4.int_ProgressValue_M = 0xbb;
            t_m4.str_Author_M = "作者：王春永";
            t_m4.str_Cover_M = "/Images/InternalDefaultBook/博弈论的诡计.jpg";
            t_m4.str_Id_M = "博弈论的诡计";
            t_m4.str_Title_M = "博弈论的诡计";
            SettingHelper.SaveInToSettings("ReaderHistory1", t_m);
            SettingHelper.SaveInToSettings("ReaderHistory2", t_m2);
            SettingHelper.SaveInToSettings("ReaderHistory3", t_m3);
            SettingHelper.SaveInToSettings("ReaderHistory4", t_m4);
            LocalBookProgressListModel t_m5 = new LocalBookProgressListModel() { double_ReaderProgress_M = 0.0, int_ReaderIndex_M = 0},
             t_m6 = new LocalBookProgressListModel() { double_ReaderProgress_M = 0.0, int_ReaderIndex_M = 0 },
             t_m7 = new LocalBookProgressListModel() { double_ReaderProgress_M = 0.0, int_ReaderIndex_M = 0 },
             t_m8 = new LocalBookProgressListModel() { double_ReaderProgress_M = 0.0, int_ReaderIndex_M = 0 };          
            SettingHelper.SaveInToSettings(t_m.str_Id_M + "CurrentReaderBook", t_m5);
            SettingHelper.SaveInToSettings(t_m2.str_Id_M + "CurrentReaderBook", t_m6);
            SettingHelper.SaveInToSettings(t_m3.str_Id_M + "CurrentReaderBook", t_m7);
            SettingHelper.SaveInToSettings(t_m4.str_Id_M + "CurrentReaderBook", t_m8);
            App.LocalBook.AddBookList(t_m);
            App.LocalBook.AddBookList(t_m2);
            App.LocalBook.AddBookList(t_m3);
            App.LocalBook.AddBookList(t_m4);
        }

        public static bool IsInternalBook(string id)
        {
            if ((!(id == "xchya10003") && !(id == "smzhx10002")) && !(id == "txsn10001") && !(id == "博弈论的诡计"))
            {
                return false;
            }
            return true;
        }
    }
}
